package burubaka.meta;

//@javax.annotation.Generated(value = { "slim3-gen", "@VERSION@" }, date = "2012-05-04 21:41:08")
/** */
public final class TotalResultMeta extends org.slim3.datastore.ModelMeta<burubaka.model.TotalResult> {

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Integer> bets = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Integer>(this, "bets", "bets", int.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Integer> hit = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Integer>(this, "hit", "hit", int.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult> hitOrder = new org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult>(this, "hitOrder", "hitOrder");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Double> hitRate = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Double>(this, "hitRate", "hitRate", double.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult> hitRateOrder = new org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult>(this, "hitRateOrder", "hitRateOrder");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, com.google.appengine.api.datastore.Key> key = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, com.google.appengine.api.datastore.Key>(this, "__key__", "key", com.google.appengine.api.datastore.Key.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult> lastHitOrder = new org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult>(this, "lastHitOrder", "lastHitOrder");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult> lastHitRateOrder = new org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult>(this, "lastHitRateOrder", "lastHitRateOrder");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult> lastWithdrawalOrder = new org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult>(this, "lastWithdrawalOrder", "lastWithdrawalOrder");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult> lastWithdrawalRateOrder = new org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult>(this, "lastWithdrawalRateOrder", "lastWithdrawalRateOrder");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Long> version = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Long>(this, "version", "version", java.lang.Long.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Long> wager = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Long>(this, "wager", "wager", long.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Long> withdrawal = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Long>(this, "withdrawal", "withdrawal", long.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult> withdrawalOrder = new org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult>(this, "withdrawalOrder", "withdrawalOrder");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Double> withdrawalRate = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.TotalResult, java.lang.Double>(this, "withdrawalRate", "withdrawalRate", double.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult> withdrawalRateOrder = new org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult>(this, "withdrawalRateOrder", "withdrawalRateOrder");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult> year = new org.slim3.datastore.StringAttributeMeta<burubaka.model.TotalResult>(this, "year", "year");

    private static final TotalResultMeta slim3_singleton = new TotalResultMeta();

    /**
     * @return the singleton
     */
    public static TotalResultMeta get() {
       return slim3_singleton;
    }

    /** */
    public TotalResultMeta() {
        super("TotalResult", burubaka.model.TotalResult.class);
    }

    @Override
    public burubaka.model.TotalResult entityToModel(com.google.appengine.api.datastore.Entity entity) {
        burubaka.model.TotalResult model = new burubaka.model.TotalResult();
        model.setBets(longToPrimitiveInt((java.lang.Long) entity.getProperty("bets")));
        model.setHit(longToPrimitiveInt((java.lang.Long) entity.getProperty("hit")));
        model.setHitOrder((java.lang.String) entity.getProperty("hitOrder"));
        model.setHitRate(doubleToPrimitiveDouble((java.lang.Double) entity.getProperty("hitRate")));
        model.setHitRateOrder((java.lang.String) entity.getProperty("hitRateOrder"));
        model.setKey(entity.getKey());
        model.setLastHitOrder((java.lang.String) entity.getProperty("lastHitOrder"));
        model.setLastHitRateOrder((java.lang.String) entity.getProperty("lastHitRateOrder"));
        model.setLastWithdrawalOrder((java.lang.String) entity.getProperty("lastWithdrawalOrder"));
        model.setLastWithdrawalRateOrder((java.lang.String) entity.getProperty("lastWithdrawalRateOrder"));
        model.setVersion((java.lang.Long) entity.getProperty("version"));
        model.setWager(longToPrimitiveLong((java.lang.Long) entity.getProperty("wager")));
        model.setWithdrawal(longToPrimitiveLong((java.lang.Long) entity.getProperty("withdrawal")));
        model.setWithdrawalOrder((java.lang.String) entity.getProperty("withdrawalOrder"));
        model.setWithdrawalRate(doubleToPrimitiveDouble((java.lang.Double) entity.getProperty("withdrawalRate")));
        model.setWithdrawalRateOrder((java.lang.String) entity.getProperty("withdrawalRateOrder"));
        model.setYear((java.lang.String) entity.getProperty("year"));
        return model;
    }

    @Override
    public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) {
        burubaka.model.TotalResult m = (burubaka.model.TotalResult) model;
        com.google.appengine.api.datastore.Entity entity = null;
        if (m.getKey() != null) {
            entity = new com.google.appengine.api.datastore.Entity(m.getKey());
        } else {
            entity = new com.google.appengine.api.datastore.Entity(kind);
        }
        entity.setProperty("bets", m.getBets());
        entity.setProperty("hit", m.getHit());
        entity.setProperty("hitOrder", m.getHitOrder());
        entity.setProperty("hitRate", m.getHitRate());
        entity.setProperty("hitRateOrder", m.getHitRateOrder());
        entity.setProperty("lastHitOrder", m.getLastHitOrder());
        entity.setProperty("lastHitRateOrder", m.getLastHitRateOrder());
        entity.setProperty("lastWithdrawalOrder", m.getLastWithdrawalOrder());
        entity.setProperty("lastWithdrawalRateOrder", m.getLastWithdrawalRateOrder());
        entity.setProperty("version", m.getVersion());
        entity.setProperty("wager", m.getWager());
        entity.setProperty("withdrawal", m.getWithdrawal());
        entity.setProperty("withdrawalOrder", m.getWithdrawalOrder());
        entity.setProperty("withdrawalRate", m.getWithdrawalRate());
        entity.setProperty("withdrawalRateOrder", m.getWithdrawalRateOrder());
        entity.setProperty("year", m.getYear());
        entity.setProperty("slim3.schemaVersion", 1);
        return entity;
    }

    @Override
    protected com.google.appengine.api.datastore.Key getKey(Object model) {
        burubaka.model.TotalResult m = (burubaka.model.TotalResult) model;
        return m.getKey();
    }

    @Override
    protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
        validateKey(key);
        burubaka.model.TotalResult m = (burubaka.model.TotalResult) model;
        m.setKey(key);
    }

    @Override
    protected long getVersion(Object model) {
        burubaka.model.TotalResult m = (burubaka.model.TotalResult) model;
        return m.getVersion() != null ? m.getVersion().longValue() : 0L;
    }

    @Override
    protected void assignKeyToModelRefIfNecessary(com.google.appengine.api.datastore.AsyncDatastoreService ds, java.lang.Object model) {
    }

    @Override
    protected void incrementVersion(Object model) {
        burubaka.model.TotalResult m = (burubaka.model.TotalResult) model;
        long version = m.getVersion() != null ? m.getVersion().longValue() : 0L;
        m.setVersion(Long.valueOf(version + 1L));
    }

    @Override
    protected void prePut(Object model) {
    }

    @Override
    protected void postGet(Object model) {
    }

    @Override
    public String getSchemaVersionName() {
        return "slim3.schemaVersion";
    }

    @Override
    public String getClassHierarchyListName() {
        return "slim3.classHierarchyList";
    }

    @Override
    protected boolean isCipherProperty(String propertyName) {
        return false;
    }

    @Override
    protected void modelToJson(org.slim3.datastore.json.JsonWriter writer, java.lang.Object model, int maxDepth, int currentDepth) {
        burubaka.model.TotalResult m = (burubaka.model.TotalResult) model;
        writer.beginObject();
        org.slim3.datastore.json.Default encoder0 = new org.slim3.datastore.json.Default();
        writer.setNextPropertyName("bets");
        encoder0.encode(writer, m.getBets());
        writer.setNextPropertyName("hit");
        encoder0.encode(writer, m.getHit());
        if(m.getHitOrder() != null){
            writer.setNextPropertyName("hitOrder");
            encoder0.encode(writer, m.getHitOrder());
        }
        writer.setNextPropertyName("hitRate");
        encoder0.encode(writer, m.getHitRate());
        if(m.getHitRateOrder() != null){
            writer.setNextPropertyName("hitRateOrder");
            encoder0.encode(writer, m.getHitRateOrder());
        }
        if(m.getLastHitOrder() != null){
            writer.setNextPropertyName("lastHitOrder");
            encoder0.encode(writer, m.getLastHitOrder());
        }
        if(m.getLastHitRateOrder() != null){
            writer.setNextPropertyName("lastHitRateOrder");
            encoder0.encode(writer, m.getLastHitRateOrder());
        }
        if(m.getLastWithdrawalOrder() != null){
            writer.setNextPropertyName("lastWithdrawalOrder");
            encoder0.encode(writer, m.getLastWithdrawalOrder());
        }
        if(m.getLastWithdrawalRateOrder() != null){
            writer.setNextPropertyName("lastWithdrawalRateOrder");
            encoder0.encode(writer, m.getLastWithdrawalRateOrder());
        }
        writer.setNextPropertyName("wager");
        encoder0.encode(writer, m.getWager());
        writer.setNextPropertyName("withdrawal");
        encoder0.encode(writer, m.getWithdrawal());
        if(m.getWithdrawalOrder() != null){
            writer.setNextPropertyName("withdrawalOrder");
            encoder0.encode(writer, m.getWithdrawalOrder());
        }
        writer.setNextPropertyName("withdrawalRate");
        encoder0.encode(writer, m.getWithdrawalRate());
        if(m.getWithdrawalRateOrder() != null){
            writer.setNextPropertyName("withdrawalRateOrder");
            encoder0.encode(writer, m.getWithdrawalRateOrder());
        }
        if(m.getYear() != null){
            writer.setNextPropertyName("year");
            encoder0.encode(writer, m.getYear());
        }
        writer.endObject();
    }

    @Override
    protected burubaka.model.TotalResult jsonToModel(org.slim3.datastore.json.JsonRootReader rootReader, int maxDepth, int currentDepth) {
        burubaka.model.TotalResult m = new burubaka.model.TotalResult();
        org.slim3.datastore.json.JsonReader reader = null;
        org.slim3.datastore.json.Default decoder0 = new org.slim3.datastore.json.Default();
        reader = rootReader.newObjectReader("bets");
        m.setBets(decoder0.decode(reader, m.getBets()));
        reader = rootReader.newObjectReader("hit");
        m.setHit(decoder0.decode(reader, m.getHit()));
        reader = rootReader.newObjectReader("hitOrder");
        m.setHitOrder(decoder0.decode(reader, m.getHitOrder()));
        reader = rootReader.newObjectReader("hitRate");
        m.setHitRate(decoder0.decode(reader, m.getHitRate()));
        reader = rootReader.newObjectReader("hitRateOrder");
        m.setHitRateOrder(decoder0.decode(reader, m.getHitRateOrder()));
        reader = rootReader.newObjectReader("lastHitOrder");
        m.setLastHitOrder(decoder0.decode(reader, m.getLastHitOrder()));
        reader = rootReader.newObjectReader("lastHitRateOrder");
        m.setLastHitRateOrder(decoder0.decode(reader, m.getLastHitRateOrder()));
        reader = rootReader.newObjectReader("lastWithdrawalOrder");
        m.setLastWithdrawalOrder(decoder0.decode(reader, m.getLastWithdrawalOrder()));
        reader = rootReader.newObjectReader("lastWithdrawalRateOrder");
        m.setLastWithdrawalRateOrder(decoder0.decode(reader, m.getLastWithdrawalRateOrder()));
        reader = rootReader.newObjectReader("wager");
        m.setWager(decoder0.decode(reader, m.getWager()));
        reader = rootReader.newObjectReader("withdrawal");
        m.setWithdrawal(decoder0.decode(reader, m.getWithdrawal()));
        reader = rootReader.newObjectReader("withdrawalOrder");
        m.setWithdrawalOrder(decoder0.decode(reader, m.getWithdrawalOrder()));
        reader = rootReader.newObjectReader("withdrawalRate");
        m.setWithdrawalRate(decoder0.decode(reader, m.getWithdrawalRate()));
        reader = rootReader.newObjectReader("withdrawalRateOrder");
        m.setWithdrawalRateOrder(decoder0.decode(reader, m.getWithdrawalRateOrder()));
        reader = rootReader.newObjectReader("year");
        m.setYear(decoder0.decode(reader, m.getYear()));
        return m;
    }
}